﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AreaHelper;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {            
            Console.WriteLine("请输入查询省份字符串,输入0则结束本程序");
            for (string s = Console.ReadLine().Replace(" ",""); s != "0"; Console.WriteLine("请输入查询省份字符串,输入0则结束本程序"),s = Console.ReadLine().Replace(" ", ""))
            {
                List<Province> provinces = Area.GetProvince(s);
                Console.WriteLine(provinces.Count > 0 ? "查询到的省份有：" : "没有匹配的查询结果");
                foreach (Province pro in provinces)
                {
                    Console.WriteLine(pro.Name);
                    Console.WriteLine(pro.Name+" 下的城市：");
                    foreach (City city in pro.Cities)
                    {
                        Console.Write("  " + city.Name);
                        //foreach (County county in city.Counties)
                        //{
                        //    Console.WriteLine("    " + county.Name);
                        //}
                    }
                    Console.WriteLine("\r\n");
                }
                Console.WriteLine();
            }
            //Console.Read();
        }
    }
}
